package com.dlmz.view;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;

@SuppressWarnings("serial")
public class StatisticManage extends JFrame{
	public static void main(String[] args)   
    {    
        new StatisticManage();  
    }  
    private JScrollPane jsp;
	private JTable resultTb; 
	private StatisticsModel sm;
	
	public StatisticManage()  
    {  
        super("健康文件报表");
        /***************************初始化面板控件***********************/  
        
        sm = new StatisticsModel();  
        String sql = "select * from st_heal_view";  
        sm.queryStatistic(sql);  
        resultTb = new JTable(sm);  
        jsp = new JScrollPane(resultTb);  
        //......构建整体布局    
        this.add(jsp,BorderLayout.CENTER);  
        //========设置窗口属性  
        validate();
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setSize(1000,400);
		this.setLocationRelativeTo(null);
		setVisible(true);
		this.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				if (JOptionPane.showConfirmDialog(StatisticManage.this, "是否退出统计？")==JOptionPane.OK_OPTION) {
					dispose();
					new StudentManage();
				}else {
					new StatisticManage();
				}
			}
		});
    }  
}
